<?php

class FinanceAction extends Action
{
    /**
     * FinanceAction::_initialize()
     * 
     * @return
     */
    public function _initialize()
    {
        checkLoginSession();
    }
	
	
    /**
     * FinanceAction::index()
     * 
     * @return
     */
    public function index()
    {
	checkLoginSession();
	//checkFinance();
    }
    /**
     * FinanceAction::chargeApply()
     * 
     * @return
     */
    public function chargeApply()
    {		
        $Msg = M('Msg');
		//dump($_SESSION['UserInfo']);
		$data['from_id_user'] = $_SESSION['UserInfo']['id'];
		$data['attach1'] = '淘宝充值名：'.$_POST['taoid'];
		$data['attach2'] = '淘宝交易号：'.$_POST['sn'];
        $data['insertTime'] = date('Y-m-d H:i:s');          
		$data['msgkind'] = 'chargeApply';
        $data['msg'] = '充值申请记录'.$data['insertTime'];		
		$topid = $Msg->add($data);	
		if($topid){echo ajaxrt('ok',$topid);}
		else{echo ajaxrt('error','写入记录出错！');}
	    //$this->display('Public:panel');
    }

    public function chargeSureApply()
    {		
        $Msg = M('Msg');
		//dump($_SESSION['UserInfo']);
		$data['from_id_user'] = $_SESSION['UserInfo']['id'];
		$data['attach1'] = '淘宝充值名：'.$_POST['taoid'];
		$data['attach2'] = '淘宝交易号：'.$_POST['sn'];
		$data['attach3'] = '申请类别：充值保证金'; 
        $data['insertTime'] = date('Y-m-d H:i:s');       
		$data['msgkind'] = 'chargeSureApply';		
		$topid = $Msg->add($data);	
		if($topid){echo ajaxrt('ok',$topid);}
		else{echo ajaxrt('error','写入记录出错！');}
	    //$this->display('Public:panel');
    }		
}
?>